/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package peticionweb.logica.entidad;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author icardenas
 */
@Entity
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Cuipe1d.findAll", query = "SELECT c FROM Cuipe1d c")})
public class Cuipe1d implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(nullable = false)
    private Integer ipeip;
    @Column(length = 45)
    private String urlip;
    @JoinColumn(name = "idese", referencedColumnName = "idese")
    @ManyToOne(fetch = FetchType.LAZY)
    private Cusem1m cusem1m;
    @JoinColumn(name = "cidpe", referencedColumnName = "cidpe")
    @ManyToOne(fetch = FetchType.LAZY)
    private Cuper1m cuper1m;

    public Cuipe1d() {
    }

    public Cuipe1d(Integer ipeip) {
        this.ipeip = ipeip;
    }

    public Integer getIpeip() {
        return ipeip;
    }

    public void setIpeip(Integer ipeip) {
        this.ipeip = ipeip;
    }

    public String getUrlip() {
        return urlip;
    }

    public void setUrlip(String urlip) {
        this.urlip = urlip;
    }

    public Cusem1m getCusem1m() {
        return cusem1m;
    }

    public void setCusem1m(Cusem1m cusem1m) {
        this.cusem1m = cusem1m;
    }

    public Cuper1m getCuper1m() {
        return cuper1m;
    }

    public void setCuper1m(Cuper1m cuper1m) {
        this.cuper1m = cuper1m;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (ipeip != null ? ipeip.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Cuipe1d)) {
            return false;
        }
        Cuipe1d other = (Cuipe1d) object;
        if ((this.ipeip == null && other.ipeip != null) || (this.ipeip != null && !this.ipeip.equals(other.ipeip))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "peticionweb.logica.entidad.Cuipe1d[ ipeip=" + ipeip + " ]";
    }
    
}
